package com.tian.system.controller;

import java.util.List;

import com.tian.common.core.controller.BaseController;
import com.tian.common.core.domain.AjaxResult;
import com.tian.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tian.system.domain.Videodir;
import com.tian.system.service.IVideodirService;

/**
 * 视频目录 信息操作处理
 *
 * @author zcx
 * @date 2020-01-04 17:09:58
 */
@Controller
@RequestMapping("/system/videodir")
public class VideodirController extends BaseController {
    private String prefix = "system/videodir";

	@Autowired
	private IVideodirService videodirService;

	/**
	 * 查询视频目录列表
	 */
	@PostMapping("/page")
	@ResponseBody
	public TableDataInfo page(Videodir videodir){
		startPage();
        List<Videodir> list = videodirService.selectVideodirList(videodir);
		return getDataTable(list);
	}
	/**
	 * 查询视频目录集合
	 */
	@PostMapping("/list")
	@ResponseBody
	public String list(Videodir videodir){
		List<Videodir> list = videodirService.selectVideodirList(videodir);
		return toAjax(list);
	}
	/**
	 * 新增保存视频目录
	 */
	@PostMapping("/add")
	@ResponseBody
	public String addSave(Videodir videodir){
		return toAjax(videodirService.insertVideodir(videodir));
	}

	/**
	 * 修改保存视频目录
	 */
	@PostMapping("/edit")
	@ResponseBody
	public String editSave(Videodir videodir){
		return toAjax(videodirService.updateVideodir(videodir));
	}

	/**
	 * 删除视频目录
	 */
	@PostMapping( "/remove")
	@ResponseBody
	public String remove(long id){
		return toAjax(videodirService.deleteVideodirById(id));
	}

	/**
	 * 删除视频目录
	 */
	@PostMapping( "/removes")
	@ResponseBody
	public String removes(String ids){
		return toAjax(videodirService.deleteVideodirByIds(ids));
	}

}
